import { IMyApp } from "../../../app"
const app = getApp<IMyApp>()

Page({
  data: {
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
  },
  onLoad() {

  },
  bindGetUserInfo (e: any) {
    // wxml 授权按钮回调本函数
    if(e && e.detail && e.detail.userInfo){
       this.setData({
         hasUserInfo : true,
       });

      app.globalData.userInfo = e.detail.userInfo;
    }
  },

  gotoReceiveAddress(){
    wx.navigateTo({ url: "/pages/ucenter/address/address" });
  },
  goAddress() {
    wx.navigateTo({ url: "/pages/ucenter/address/address" });
  },
  toastMsg() {
    wx.showToast({
      title: '功能还在开发中',
      icon: 'none',
      duration: 2000
    });
  },
  toastAboutUs() {
    wx.showModal({
      title: "您好，",
      showCancel: false,
      content: '本程序作者：mail@chenrh.com',
      success(res) {
        if (res.confirm) {
        }
      }
    })
  }

})
